/*
 * CriarFonteEletromagnetica.java
 *
 * Created on 17 de Novembro de 2008, 08:05
 */

package br.com.cpqd.ssar.mediador.gui;

import br.com.cpqd.ssar.mediador.ControladorFonteEletromagnetica;
import br.com.cpqd.ssar.utilitarias.FonteEletromagnetica;
import br.com.cpqd.ssar.utilitarias.TiposdeFonteEletromagnetica;
import java.awt.Color;
import java.io.IOException;
import java.util.StringTokenizer;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JColorChooser;

/**
 *
 * @author  carlos
 */
public class JanelaCriarFonteEletromagnetica extends javax.swing.JDialog {

    /**
     * Controlador das Fontes Eletromagneticas
     */
    private ControladorFonteEletromagnetica controladorFonteEletromagnetica;
    
    /**
     * 
     * @param parent
     * @param modal
     * @throws java.io.IOException
     */
    public JanelaCriarFonteEletromagnetica(java.awt.Frame parent, boolean modal) throws IOException {
        super(parent, modal);
        controladorFonteEletromagnetica = new ControladorFonteEletromagnetica();
        //this.controladorJanelas = controladorJanelas;
        initComponents();              
        
        mudarPropriedadesJanela();
    }
    
    /**
     * Tenta Aplicar as Propriedades Editadas
     */
    private FonteEletromagnetica tentarAplicarPropriedades() {
        Color cor           = jPanelCor.getBackground();
        boolean nenhumErro  = true;
        String nome         = null;
        String type         = new String();
        String linha;
        Vector vetor        = new Vector();        
        StringTokenizer strtoken;
        TiposdeFonteEletromagnetica tipofonte;
        int id;

        // Testa o nome
        try {           
            nome = jTextFieldNomeFonte.getText();
            // Não deve conter os seguintes Caracteres
            if (nome.contains(".") || nome.contains("\\")) {
                jTextFieldNomeFonte.setForeground(Color.RED);
                nenhumErro = false;
            }
        } catch (Exception e) {
            jTextFieldNomeFonte.setForeground(Color.RED);
            nenhumErro = false;
        }
        
        // Testar P1
        try {
            if (jtxtP1.isEnabled()==true)
                vetor.add(Double.valueOf(jtxtP1.getText()));
        } catch (Exception e) {
            jtxtP1.setForeground(Color.RED);
            nenhumErro = false;
        }
        
        // Testar P2
        try {
            if (jtxtP2.isEnabled()==true)
                vetor.add(Double.valueOf(jtxtP2.getText()));
        } catch (Exception e) {
            jtxtP2.setForeground(Color.RED);
            nenhumErro = false;
        }
        
        // Testar P3
        try {
            if (jtxtP3.isEnabled()==true)
                vetor.add(Double.valueOf(jtxtP3.getText()));
        } catch (Exception e) {
            jtxtP3.setForeground(Color.RED);
            nenhumErro = false;
        }

        // Testar P4
        try {
            if (jtxtP4.isVisible()==true)
                vetor.add(Double.valueOf(jtxtP4.getText()));
        } catch (Exception e) {
            jtxtP4.setForeground(Color.RED);
            nenhumErro = false;
        }

        if (nenhumErro) {           
            // Retornar o tipo de fonte eletromagnetica selecionada
            tipofonte = new TiposdeFonteEletromagnetica();
            tipofonte = (TiposdeFonteEletromagnetica) jComboBoxFontes.getSelectedItem();            
            FonteEletromagnetica  fonte = new FonteEletromagnetica();
            fonte.setName(jTextFieldNomeFonte.getText());
            fonte.setIdType(tipofonte.getId());
            fonte.setDirection(jComboDirecao.getSelectedItem().toString());
            fonte.setColor(jPanelCor.getBackground());
            fonte.setField(jComboCampo.getSelectedItem().toString());
            fonte.setParameters(vetor);
            return fonte;
        } else {
//                Toolkit.getDefaultToolkit().beep();
            return null;
        }
    }
    
    /**
     * Muda propriedades apresentadas na Janela
     */
    private void mudarPropriedadesJanela(){
        TiposdeFonteEletromagnetica fonte = (TiposdeFonteEletromagnetica) jComboBoxFontes.getSelectedItem();

        // Atribuir aos Labels e Text Box a invisibilidade
        jlblP1.setVisible(false);
        jlblP2.setVisible(false);
        jlblP3.setVisible(false);
        jlblP4.setVisible(false);
        
        jtxtP1.setVisible(false);
        jtxtP2.setVisible(false);
        jtxtP3.setVisible(false);
        jtxtP4.setVisible(false);

        jlblP1.setEnabled(false);
        jlblP2.setEnabled(false);
        jlblP3.setEnabled(false);
        jlblP4.setEnabled(false);
        
        jtxtP1.setEnabled(false);
        jtxtP2.setEnabled(false);
        jtxtP3.setEnabled(false);
        jtxtP4.setEnabled(false);
        
        if (fonte != null){
            if (fonte.getNParameters()>0)
            {
                jlblP1.setText(fonte.getParameterName(0)+":");
                jlblP1.setVisible(true);
                jtxtP1.setVisible(true);
            }
            if (fonte.getNParameters()>1)
            {
                jlblP2.setText(fonte.getParameterName(1)+":");
                jlblP2.setVisible(true);
                jtxtP2.setVisible(true);
            }
            if (fonte.getNParameters()>2)
            {
                jlblP3.setText(fonte.getParameterName(2)+":");
                jlblP3.setVisible(true);
                jtxtP3.setVisible(true);
            }
            if (fonte.getNParameters()>3)
            {
                jlblP4.setText(fonte.getParameterName(3)+":");
                jlblP4.setVisible(true);
                jtxtP4.setVisible(true);
            }   
            
            if ((jComboCampo.getSelectedIndex()>=1)&&(jComboDirecao.getSelectedIndex()>=1)){
                
                jlblP1.setEnabled(true);
                jlblP2.setEnabled(true);
                jlblP3.setEnabled(true);
                jlblP4.setEnabled(true);
                
                jtxtP1.setEnabled(true);
                jtxtP2.setEnabled(true);
                jtxtP3.setEnabled(true);
                jtxtP4.setEnabled(true);
                
                btnConfirmar.setEnabled(true);
                
            }
            
            if ((jtxtP1.getText().length()>0)||(jtxtP2.getText().length()>0)||
                (jtxtP3.getText().length()>0)||(jtxtP4.getText().length()>0)){
                btnConfirmar.setEnabled(true);                
            }
            
        }
    }        

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        btnCancelar = new javax.swing.JButton();
        btnConfirmar = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jTextFieldNomeFonte = new javax.swing.JTextField();
        jComboBoxFontes = new javax.swing.JComboBox();
        jPanelCor = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jComboCampo = new javax.swing.JComboBox();
        jComboDirecao = new javax.swing.JComboBox();
        jtxtP4 = new javax.swing.JTextField();
        jtxtP2 = new javax.swing.JTextField();
        jtxtP1 = new javax.swing.JTextField();
        jtxtP3 = new javax.swing.JTextField();
        jlblP1 = new javax.swing.JLabel();
        jlblP2 = new javax.swing.JLabel();
        jlblP4 = new javax.swing.JLabel();
        jlblP3 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Criar Fonte Eletromagnética");

        jPanel1.setBackground(new java.awt.Color(231, 240, 250));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Cadastrar Fonte Eletromagnética"));

        btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/cpqd/ssar/gerenciador/gui/recursos/Cancelar.png"))); // NOI18N
        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });

        btnConfirmar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/cpqd/ssar/gerenciador/gui/recursos/confirmar.png"))); // NOI18N
        btnConfirmar.setText("Confirmar");
        btnConfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConfirmarActionPerformed(evt);
            }
        });

        jLabel2.setText("Nome: ");

        jLabel1.setText("Fonte:");

        jComboBoxFontes.setModel(controladorFonteEletromagnetica.getModelo());
        jComboBoxFontes.setActionCommand("");
        jComboBoxFontes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxFontesActionPerformed(evt);
            }
        });

        jPanelCor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102)));
        jPanelCor.setToolTipText("Cor do Material");
        jPanelCor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jPanelCorMousePressed(evt);
            }
        });

        javax.swing.GroupLayout jPanelCorLayout = new javax.swing.GroupLayout(jPanelCor);
        jPanelCor.setLayout(jPanelCorLayout);
        jPanelCorLayout.setHorizontalGroup(
            jPanelCorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 39, Short.MAX_VALUE)
        );
        jPanelCorLayout.setVerticalGroup(
            jPanelCorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 19, Short.MAX_VALUE)
        );

        jLabel3.setText("Campo: ");

        jLabel4.setText("Direção:");

        jComboCampo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Selecionar --", "Elétrico", "Magnético" }));
        jComboCampo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboCampojComboBoxCampo(evt);
            }
        });

        jComboDirecao.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Selecionar --", "x", "y", "z" }));
        jComboDirecao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboDirecaojComboBoxDirecao(evt);
            }
        });

        jtxtP4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtP4Action(evt);
            }
        });

        jtxtP2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtP2Action(evt);
            }
        });

        jtxtP1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtP1Action(evt);
            }
        });

        jtxtP3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtP3Action(evt);
            }
        });

        jlblP1.setText("p1:");

        jlblP2.setText("p2:");

        jlblP4.setText("p4:");

        jlblP3.setText("p3:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addGap(10, 10, 10)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jTextFieldNomeFonte, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(26, 26, 26)
                                .addComponent(jPanelCor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jComboBoxFontes, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap(38, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jlblP4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlblP3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlblP2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlblP1, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE))
                        .addGap(4, 4, 4)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtxtP4)
                            .addComponent(jtxtP3)
                            .addComponent(jtxtP2)
                            .addComponent(jtxtP1, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE))
                        .addGap(77, 77, 77))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(10, 10, 10)
                        .addComponent(jComboCampo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(194, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(10, 10, 10)
                        .addComponent(jComboDirecao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(194, Short.MAX_VALUE))))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(127, 127, 127)
                .addComponent(btnConfirmar)
                .addGap(18, 18, 18)
                .addComponent(btnCancelar)
                .addContainerGap(26, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel2)
                    .addComponent(jTextFieldNomeFonte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelCor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel1)
                    .addComponent(jComboBoxFontes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel3)
                    .addComponent(jComboCampo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel4)
                    .addComponent(jComboDirecao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtxtP1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlblP1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlblP2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxtP2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(14, 14, 14)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlblP3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxtP3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlblP4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxtP4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnConfirmar)
                    .addComponent(btnCancelar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btnConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarActionPerformed
    FonteEletromagnetica fonte = this.tentarAplicarPropriedades();
    if (fonte==null){
        
    } else {
            try {
                controladorFonteEletromagnetica.adicionarFonte(fonte);
                dispose();
            } catch (IOException ex) {
                Logger.getLogger(JanelaCriarFonteEletromagnetica.class.getName()).log(Level.SEVERE, null, ex);
            }
    }

}//GEN-LAST:event_btnConfirmarActionPerformed

private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
// TODO add your handling code here:
    dispose();
    
}//GEN-LAST:event_btnCancelarActionPerformed

private void jComboBoxFontesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxFontesActionPerformed
// TODO add your handling code here:
    this.mudarPropriedadesJanela();
}//GEN-LAST:event_jComboBoxFontesActionPerformed

private void jComboCampojComboBoxCampo(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboCampojComboBoxCampo
this.mudarPropriedadesJanela();
}//GEN-LAST:event_jComboCampojComboBoxCampo

private void jComboDirecaojComboBoxDirecao(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboDirecaojComboBoxDirecao
this.mudarPropriedadesJanela();
}//GEN-LAST:event_jComboDirecaojComboBoxDirecao

private void jtxtP4Action(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtP4Action

}//GEN-LAST:event_jtxtP4Action

private void jtxtP2Action(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtP2Action

}//GEN-LAST:event_jtxtP2Action

private void jtxtP1Action(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtP1Action

}//GEN-LAST:event_jtxtP1Action

private void jtxtP3Action(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtxtP3Action

}//GEN-LAST:event_jtxtP3Action

private void jPanelCorMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanelCorMousePressed
    JColorChooser jColorChooser = new JColorChooser();                                                 
    jPanelCor.setBackground(JColorChooser.showDialog(null, "Escolher uma Cor", Color.BLACK));
// TODO add your handling code here:
}//GEN-LAST:event_jPanelCorMousePressed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnConfirmar;
    private javax.swing.JComboBox jComboBoxFontes;
    private javax.swing.JComboBox jComboCampo;
    private javax.swing.JComboBox jComboDirecao;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanelCor;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTextField jTextFieldNomeFonte;
    private javax.swing.JLabel jlblP1;
    private javax.swing.JLabel jlblP2;
    private javax.swing.JLabel jlblP3;
    private javax.swing.JLabel jlblP4;
    private javax.swing.JTextField jtxtP1;
    private javax.swing.JTextField jtxtP2;
    private javax.swing.JTextField jtxtP3;
    private javax.swing.JTextField jtxtP4;
    // End of variables declaration//GEN-END:variables

}
